<template>
	<div>
		<p><h3>批次信息</h3></p>
		<el-divider ></el-divider>
		<div id="batchInfoDiv">
      <el-table
      :data="batchInfo"
      :header-cell-style="{background:'#eef1f6',color:'#606266','text-align':'center',fontSize:'15px'}"
      :cell-style="{'text-align':'center'}"
      style="width: 100%">
          <el-table-column
            :label="batchName"
            >
            <el-table-column
            prop="levelName"
            label="批次等级">
            </el-table-column>
            <el-table-column
            prop="phaseTeacherStart"
            label="批次申报开始日期">
            </el-table-column>
            <el-table-column
            prop="phaseTeacherEnd"
            label="批次申报结束日期">
            </el-table-column>
            <el-table-column
            prop="phaseSchoolSecondStart"
            label="批次校级二次审核开始日期">
            </el-table-column>
            <el-table-column
            prop="phaseSchoolSecondEnd"
            label="批次校级二次审核结束日期">
            </el-table-column>
          </el-table-column>
      </el-table>
		</div>
    <div id="ProjectInfo">
        <el-dialog
          title="项目名称查重"
          :visible.sync="dialogBatchNameVisible"
          width="50%"
          :before-close="handleClose">
          <el-row>
            <el-col :span="12">
              <h1 style="display: inline;">项目名称:</h1>
              <span>
                <el-button size="mini" type="primary" @click="dialogViewDetails()">查看详情</el-button>
              </span>
              <h2>{{dialogProjectName}}</h2>

            </el-col>
            <el-col :span="12">
               <el-table
                    :data="batchProNameContrast"
                    :header-cell-style="{background:'#eef1f6',color:'#606266','text-align':'center'}"
                    :cell-style="{'text-align':'center'}"
                    style="width: 100%">
                    <el-table-column
                      prop="ProName"
                      label="项目名称"
                     >
                    </el-table-column>
                    <el-table-column
                      prop="nameRepetitionRate"
                      label="项目名称查重"
                     >
                     <template slot-scope="scope">
                         <p>{{(scope.row.nameRepetitionRate*100).toFixed(2)+'%'}}</p>
                     </template>
                    </el-table-column>
                    <el-table-column
                      label="操作"
                     >
                     <template slot-scope="scope">
                         <el-button size="mini" type="primary" @click="viewDetails(scope.row.ProId)">查看详情</el-button>
                     </template>
                    </el-table-column>
                  </el-table>
            </el-col>
          </el-row>
          <span slot="footer" class="dialog-footer">
            <el-button @click="dialogBatchNameVisible = false">取 消</el-button>
            <el-button type="primary" @click="dialogBatchNameVisible = false">确 定</el-button>
          </span>
        </el-dialog>
        <el-row type="flex">
          <el-col :span="12">
            <p><h3>项目信息</h3></p>
          </el-col>
          <el-col :span="12">
            <div style="position:relative; top:50%;transform:translateY(-50%);text-align: right;">
              学院：
              <el-select v-model="selectedDep" filterable placeholder="请选择学院">
                  <el-option
                    v-for="(item,index) in depOptions"
                    :key="index"
                    :label="item"
                    :value="item">
                  </el-option>
                </el-select>
            </div>
          </el-col>
        </el-row>
        <el-divider ></el-divider>
        <el-row>
          <el-col :span="12">
            <el-button type="success" @click="lotSizePass" >批量通过</el-button>
            <el-button type="danger" @click="lotSizeNoppass">批量不通过</el-button>
            <el-button type="primary" @click="lotSizeRevoke">批量撤销</el-button>
          </el-col>
          <el-col :span="12">
            <div style="text-align: right;">
              <el-button type="success" @click="auditSubmit">审核提交</el-button>
            </div>
          </el-col>
        </el-row>

        <div id="ProjectTable" style="margin-top: 25px;">
          <el-table
              :stripe='true'
              ref="multipleTable"
              :data="tableData"
              tooltip-effect="dark"
              style="width: 100%"
              @selection-change="handleSelectionChange"
              :header-cell-style="{'text-align':'center',background:'#eef1f6',color:'#606266',}"
              :cell-style="{'text-align':'center'}"
              >
              <el-table-column
                type="selection"
                width="55">
              </el-table-column>
              <el-table-column
                label="项目名称"
                width="120">
                <template slot-scope="scope">{{ scope.row.proName }}</template>
              </el-table-column>
              <el-table-column
                prop="classification"
                label="科目"
                width="120">
              </el-table-column>
              <el-table-column
                prop="proDepartment"
                label="所属学院"
                width="120">
              </el-table-column>
              <el-table-column
                prop="memberName"
                label="主持人"
                width="120">
              </el-table-column>
              <el-table-column
                label="专家评分"
                sortable
                prop="score"
                width="120">
              </el-table-column>
              <el-table-column
                label="专家意见"
                prop="message"
                width="120">
              </el-table-column>

              <el-table-column
                label="项目名称查重"
                prop="maxRepeatNum"
                sortable
                >
                <template slot-scope="scope">
                   <p >{{(scope.row.maxRepeatNum*100).toFixed(2)+'%'}}</p>
                   <el-button size="mini" type="primary" @click="viewBatchNameRepeat(scope.row,scope.$index)">查看详情</el-button>
                </template>
              </el-table-column>
              <el-table-column
                label="查看详情"
                width="120">
                <template slot-scope="scope">
                    <el-button size="mini" type="primary" @click="viewDetails(scope.row.proId)">查看详情</el-button>
                </template>
              </el-table-column>
              <el-table-column
                label="学校意见类型"
                width="120">
                <template slot-scope="scope">
                  <span v-if="scope.row.proApproval==8 || scope.row.proApproval==9">
                      <p v-if="scope.row.proApproval==8">通过</p>
                      <p v-if="scope.row.proApproval==9">不通过</p>
                  </span>
                  <span v-else>未填写</span>
                </template>
              </el-table-column>
              <el-table-column
                label="操作"
                show-overflow-tooltip>
                <template slot-scope="scope">
                  <span v-if="scope.row.proApproval==8 || scope.row.proApproval==9">
                    <span v-if="scope.row.proApproval==8">
                      <el-button size="mini" type="success" @click="revokeSubmit(scope.$index,scope.row)" >撤销通过</el-button>
                    </span>
                    <span v-if="scope.row.proApproval==9">
                      <el-button size="mini" type="success" @click="revokeSubmit(scope.$index,scope.row)" >撤销不通过</el-button>
                    </span>
                  </span>
                  <span v-else>
                    <el-button size="mini" type="infor" @click="passTheAudit(scope.$index,scope.row)">通过</el-button>
                    <el-button size="mini" type="danger" @click="failToPassTheAudit(scope.$index,scope.row)">不通过</el-button>
                  </span>
                </template>
              </el-table-column>
            </el-table>
        </div>

    </div>
	</div>

</template>

<script>
export default {
		data() {
			return {
        depOptions: [],
        selectedDep:'',
        //临时index
        tempProId:'',
        tempIndex:'',
        //弹窗条件
        dialogTableVisible:false,
        dialogBatchNameVisible:false,
        //批次名称
        batchName:'',
        //批次ID
				thisBatchId:'',
        dialogProjectInfo:{
          proSchool:'',
        },
        //批次信息
				batchInfo:[],
				batchPrePassNumber:0,
        teacherInfo:'',
        maxPassNum:'',
        tableData: [],
        allProject:[],
        multipleSelection: [],
        //批次名称对比信息
        batchProNameContrast:[],
        dialogProjectName:''
			}
		},
    created() {
      this.thisBatchId=this.$route.query.batch_id;
      this.teacherInfo=this.$store.state.info
      this.getBatchInfo()
      this.getProjectDataAxios()

    },
    mounted(){
    },
    watch:{
      //监听selectedDep变量
      selectedDep(){
          this.showTableBySeleDep()
      }
    },
		methods: {
      getExpertScores(){
        this.$api.expert.getExpertScores().then((response)=>{
          for(let i=0;i<response.data.data.length;i++){
            for(let j=0;j<this.tableData.length;j++){
              if(response.data.data[i].proId==this.tableData[j].proId){
                this.$set(this.tableData[j],"score",response.data.data[i].score)
                this.$set(this.tableData[j],"message",this.getSimpleText(response.data.data[i].message))
              }
            }
          }
          console.log(this.tableData)
        })
      },
      getNameRate(){
        var NameRepeatRate=[]
        for(let i=0;i<this.tableData.length;i++){
          this.$api.project.nameRate({
            batchId:this.thisBatchId,
            projectName:this.tableData[i].proName,
            repetitionRate:-1
          }).then((response)=>{
            response.data.data.forEach(item=>{
              if(item.nameRepetitionRate!=1){
                NameRepeatRate.push(item.nameRepetitionRate)
              }
            })
            //Math.max.apply(Math,NameRepeatRate) 查找对象中的最大值
            if(NameRepeatRate.length==0){
              this.$set(this.tableData[i],'maxRepeatNum',0)
            }else{
              this.$set(this.tableData[i],'maxRepeatNum',Math.max.apply(Math,NameRepeatRate))
            }
            NameRepeatRate=[]
          })
        }

      },
      foramtExpertStart(row,column){
        if(row.phaseExpertStart==null || row.phaseExpertStart==''){
          return "无"
        }else{
          return row.phaseExpertStart
        }
      },
      foramtExpertEnd(row,column){
        if(row.phaseExpertEnd ==null || row.phaseExpertEnd ==''){
          return "无"
        }else{
          return row.phaseExpertEnd
        }
      },
      //根据el-selected填充表格
      showTableBySeleDep(){
        var tempTableInfo=this.allProject
        if(this.selectedDep=="全部学院"){
          this.tableData=this.allProject
        }else{
          this.tableData=tempTableInfo.filter(item=>item.proDepartment==this.selectedDep)
        }
      },
      viewBatchNameRepeat(row,index){
        this.dialogBatchNameVisible=true
        this.tempProId=row.proId
        this.dialogProjectName=""
        this.batchProNameContrast=[]
        this.dialogProjectName=row.proName
        this.$api.project.nameRate({batchId:this.thisBatchId,projectName:row.proName,repetitionRate:-1}).then((response)=>{
          console.log(response)
          this.batchProNameContrast=response.data.data.filter((item)=>{return item.nameRepetitionRate!=1 && item.nameRepetitionRate!=0})
        })
      },
       handleClose(done) {
              this.$confirm('确认关闭？')
                .then(_ => {
                  done();
                })
                .catch(_ => {});
            },
      //得到所有学院，并填充
      getProjectDep(){
        var result=[]
        var isfl
        var allDep="全部学院"
        for(var i = 0 ;i < this.tableData.length;i++ ){
          isfl=false;
          for(var j=0;j< result.length;j++){
            if(this.tableData[i].proDepartment == result[j].proDepartment){
              isfl=true
              break}}
          if(!isfl){
            result.push(this.tableData[i])
          }
          }
          //先把"全部学院"填进this.depOptions数组
          this.depOptions.push(allDep)
          result.forEach(item=>{
            //再把数据库的学院填充进去
            this.depOptions.push(item.proDepartment)
          })

      }
      ,
      //格式化学院分数在table表示
      scoreFormat(row,column){
          if(row.departmentScore==null || row.departmentScore==''){
            return '未填写'
          }else{
            return row.departmentScore
          }
      },
      auditSubmit(){
        for(let i=0;i<this.tableData.length;i++){
          if(this.tableData[i].proApproval!=8 && this.tableData[i].proApproval!=9){
            this.$message({
              type: 'error',
              message: '尚有项目未作出选择!',
              duration: 2000,
              offset:screen.height/2-200,
              center:true
            })
            return
          }
        }
        this.$store.commit('getTodoList')
        this.UpdateBatchInfo()
        this.$message({
          type: 'success',
          message: '审核提交成功!',
          duration: 2000,
          offset:screen.height/2-200,
          center:true
        })


      },
      UpdateBatchInfo(){
        this.$api.batch.updateBatchStatus({
          batchId:this.thisBatchId,
          status:4,
        }).then((response)=>{
          this.goAuditBatch()
          console.log(response)
        })
      },
      goAuditBatch(){
        this.$router.push({path:'/uniApprovalAudit'})
      },
      closeDialog(){
        Object.keys(this.dialogProjectInfo).forEach(key=>{this.dialogProjectInfo[key]=''})
        this.dialogTableVisible=false
      },
      viewDetails(proId){
        this.$router.push({path:'/uniProjectAuditPdf',query:{proId:proId,batchId:this.thisBatchId}})
      },
      dialogViewDetails(){
        this.$router.push({path:'/uniSecondProjectAuditPdf',query:{proId:this.tempProId,batchId:this.thisBatchId}})
      },
      getNowDate(){
        var nowDate = new Date();
        var year = nowDate.getFullYear();
        var month = nowDate.getMonth() + 1 < 10 ? "0" + (nowDate.getMonth() + 1): nowDate.getMonth() + 1;
        var day = nowDate.getDate() < 10 ? "0" + nowDate.getDate() : nowDate
         .getDate();
        var dateStr = year + "-" + month + "-" + day;
        return  dateStr
      },
      getSimpleText(html){
        var re1 = new RegExp("<.+?>","g");//匹配html标签的正则表达式，"g"是搜索匹配多个符合的内容
        var msg = html.replace(re1,'');//执行替换成空字符
        return msg;
      },
      failToPassTheAudit(index,row){
        //赋值
        var projectMembers,projectSearchings,projectTeachings,project
        var today=this.getNowDate()
        this.$api.project.getProjectById({
          proId:row.proId
        }).then((response)=>{
          //做项目更新操作的临时数据
          project=response.data.data.project
          projectMembers=response.data.data.members
          projectSearchings=response.data.data.searchings
          projectTeachings=response.data.data.teachings
          this.$api.project.updateProject({
            projectMembers:JSON.stringify(projectMembers) ,
            projectSearchings:JSON.stringify(projectSearchings),
            projectTeachings:JSON.stringify(projectTeachings),
            proId:row.proId,
            batchId:this.thisBatchId,
            departmentScore:row.departmentScore,
            schoolDate:today,
            proApproval:9,
          })
          .then((response)=>{
            this.getProjectDataAxios()
            console.log(response)
          })
          //创建 记录
          this.$api.project.creatRecord({
              gh:this.teacherInfo.gh,
              name:this.teacherInfo.xm,
              proId:project.proId,
              state:9,
              time:this.getNowFormatDate(),
              message:"校级二次审核不通过!"
          }).then((response)=>{
            console.log(response)
          })
          this.$message({
          	message: "审核不通过操作成功!",
          	type: "success",
          	offset: screen.height / 2 - 100,
          	center: true,
            duration:1000
          })
        })
      },
      getNowFormatDate() {
          var date = new Date();
          var seperator1 = "-";
          var seperator2 = ":";
          var month = date.getMonth() + 1;
          var strDate = date.getDate();
          if (month >= 1 && month <= 9) {
              month = "0" + month;
          }
          if (strDate >= 0 && strDate <= 9) {
              strDate = "0" + strDate;
          }
          var Hours= date.getHours()
          if (Hours >= 0 && Hours <= 9) {
              Hours = "0" + Hours;
          }

          var Minutes= date.getMinutes()
          if (Minutes >= 0 && Minutes <= 9) {
              Minutes = "0" + Minutes;
          }

          var Seconds= date.getSeconds()
          if (Seconds >= 0 && Seconds <= 9) {
              Seconds = "0" + Seconds;
          }
          var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
                  + " " + Hours + seperator2 + Minutes
                  + seperator2 + Seconds;
          return currentdate;
      },
      //撤回操作
      revokeSubmit(index,row){
        //赋值
        this.tempIndex=index
        var projectMembers,projectSearchings,projectTeachings,project
        var today=this.getNowDate()
        Object.keys(this.dialogProjectInfo).forEach(key=>{this.dialogProjectInfo[key]=''})
        this.$api.project.getProjectById({
          proId:this.tableData[this.tempIndex].proId
        }).then((response)=>{
          console.log(response)
          //做项目更新操作的临时数据
          project=response.data.data.project
          projectMembers=response.data.data.members
          projectSearchings=response.data.data.searchings
          projectTeachings=response.data.data.teachings

          this.$api.project.updateProject({
            projectMembers:JSON.stringify(projectMembers) ,
            projectSearchings:JSON.stringify(projectSearchings),
            projectTeachings:JSON.stringify(projectTeachings),
            proId:this.tableData[this.tempIndex].proId,
            batchId:this.thisBatchId,
            departmentScore:this.tableData[this.tempIndex].departmentScore,
            schoolDate:'',
            proApproval:3,
          })
          .then((response)=>{
            this.getProjectDataAxios()
            console.log(response)
          })
          //创建 记录
          this.$api.project.creatRecord({
              gh:this.teacherInfo.gh,
              name:this.teacherInfo.xm,
              proId:project.proId,
              state:3,
              time:this.getNowFormatDate(),
              message:'学校二次审核撤销不通过操作'
          }).then((response)=>{
            console.log(response)
          })

        })
        this.$message({
          	message: "撤销操作成功!",
          	type: "success",
          	offset: screen.height / 2 - 100,
          	center: true,
            duration:1000
          })
      },
      //批量撤回
      lotSizeRevoke(){
        console.log(this.multipleSelection)
        var projectMembers,projectSearchings,projectTeachings,project
        for(let i=0;i<this.multipleSelection.length;i++){
            if(this.multipleSelection[i].proApproval!=8 && this.multipleSelection[i].proApproval!=9 ){
              this.$message({
              	message: "请勿选择不服符合该操作的项目!",
              	type: "warning",
              	offset: screen.height / 2 - 100,
              	center: true,
                duration:1000
              })
              return
            }}
        for(let i=0;i<this.multipleSelection.length;i++){
            this.$api.project.getProjectById({
              proId:this.multipleSelection[i].proId
            }).then((response)=>{
              //做项目更新操作的临时数据
              project=response.data.data.project
              projectMembers=response.data.data.members
              projectSearchings=response.data.data.searchings
              projectTeachings=response.data.data.teachings

              this.$api.project.updateProject({
                projectMembers:JSON.stringify(projectMembers) ,
                projectSearchings:JSON.stringify(projectSearchings),
                projectTeachings:JSON.stringify(projectTeachings),
                proId:project.proId,
                batchId:this.thisBatchId,
                departmentScore:project.departmentScore,
                schoolDate:'',
                proApproval:3,
              })
              .then((response)=>{
                console.log(response)
                this.$message({
                	message: "批量撤销操作成功!",
                	type: "success",
                	offset: screen.height / 2 - 100,
                	center: true,
                  duration:1000
                })
                this.getProjectDataAxios()
              })
              //创建 记录
              this.$api.project.creatRecord({
                  gh:this.teacherInfo.gh,
                  name:this.teacherInfo.xm,
                  proId:project.proId,
                  state:3,
                  time:this.getNowFormatDate(),
                  message:'学校二次审核撤销操作'
              }).then((response)=>{
                console.log(response)
              })
            })
        }
        this.$refs.multipleTable.clearSelection();
      },
      //批量通过
      lotSizePass(){
        console.log(this.multipleSelection)
        var projectMembers,projectSearchings,projectTeachings,project
        for(let i=0;i<this.multipleSelection.length;i++){
            if(this.multipleSelection[i].proApproval == 8 || this.multipleSelection[i].proApproval == 9){
              this.$message({
              	message: "请勿选择已操作项目!",
              	type: "warning",
              	offset: screen.height / 2 - 100,
              	center: true,
                duration:1000
              })
              return
            }}
        for(let i=0;i<this.multipleSelection.length;i++){
            this.$api.project.getProjectById({
              proId:this.multipleSelection[i].proId
            }).then((response)=>{
              console.log(response)
              //做项目更新操作的临时数据
              project=response.data.data.project
              projectMembers=response.data.data.members
              projectSearchings=response.data.data.searchings
              projectTeachings=response.data.data.teachings

              this.$api.project.updateProject({
                projectMembers:JSON.stringify(projectMembers) ,
                projectSearchings:JSON.stringify(projectSearchings),
                projectTeachings:JSON.stringify(projectTeachings),
                proId:project.proId,
                batchId:this.thisBatchId,
                schoolDate:this.getNowDate(),
                proApproval:8,
                departmentScore:project.departmentScore,
              })
              .then((response)=>{
                console.log(response)
                this.getProjectDataAxios()

                this.$message({
                	message: "批量通过操作成功!",
                	type: "success",
                	offset: screen.height / 2 - 100,
                	center: true,
                  duration:1000
                })
              })
              //创建 记录
              this.$api.project.creatRecord({
                  gh:this.teacherInfo.gh,
                  name:this.teacherInfo.xm,
                  proId:project.proId,
                  state:8,
                  time:this.getNowFormatDate(),
                  message:'学校二次审核通过'
              }).then((response)=>{
                console.log(response)
              })
            })
        }
        this.$refs.multipleTable.clearSelection();
      },
      //批量不通过
      lotSizeNoppass(){
        console.log(this.multipleSelection)
        var projectMembers,projectSearchings,projectTeachings,project
        for(let i=0;i<this.multipleSelection.length;i++){
            if(this.multipleSelection[i].proApproval == 8 || this.multipleSelection[i].proApproval == 9){
              this.$message({
              	message: "请勿选择已操作项目!",
              	type: "warning",
              	offset: screen.height / 2 - 100,
              	center: true,
                duration:1000
              })
              this.$refs.multipleTable.clearSelection();
              return
            }}
        for(let i=0;i<this.multipleSelection.length;i++){
            this.$api.project.getProjectById({
              proId:this.multipleSelection[i].proId
            }).then((response)=>{
              console.log(response)
              //做项目更新操作的临时数据
              project=response.data.data.project
              projectMembers=response.data.data.members
              projectSearchings=response.data.data.searchings
              projectTeachings=response.data.data.teachings

              this.$api.project.updateProject({
                projectMembers:JSON.stringify(projectMembers) ,
                projectSearchings:JSON.stringify(projectSearchings),
                projectTeachings:JSON.stringify(projectTeachings),
                proId:project.proId,
                batchId:this.thisBatchId,
                schoolDate:this.getNowDate(),
                proApproval:9,
                departmentScore:project.departmentScore,
              })
              .then((response)=>{
                console.log(response)
                this.getProjectDataAxios()

                this.$message({
                	message: "批量不通过操作成功!",
                	type: "success",
                	offset: screen.height / 2 - 100,
                	center: true,
                  duration:1000
                })
              })
              //创建 记录
              this.$api.project.creatRecord({
                  gh:this.teacherInfo.gh,
                  name:this.teacherInfo.xm,
                  proId:project.proId,
                  state:9,
                  time:this.getNowFormatDate(),
                  message:'学校二次审核不通过'
              }).then((response)=>{
                console.log(response)
              })
            })
        }
        this.$refs.multipleTable.clearSelection();
      },
      passTheAudit(index,row){
          //赋值
          var projectMembers,projectSearchings,projectTeachings,project
          var today=this.getNowDate()
          this.$api.project.getProjectById({
            proId:row.proId
          }).then((response)=>{
            //做项目更新操作的临时数据
            project=response.data.data.project
            projectMembers=response.data.data.members
            projectSearchings=response.data.data.searchings
            projectTeachings=response.data.data.teachings

            this.$api.project.updateProject({
              projectMembers:JSON.stringify(projectMembers) ,
              projectSearchings:JSON.stringify(projectSearchings),
              projectTeachings:JSON.stringify(projectTeachings),
              proId:row.proId,
              batchId:this.thisBatchId,
              departmentScore:row.departmentScore,
              schoolDate:today,
              //8 学校二次审核通过
              proApproval:8
            })
            .then((response)=>{
              this.getProjectDataAxios()
              console.log(response)
            })
            //创建 记录
            this.$api.project.creatRecord({
                gh:this.teacherInfo.gh,
                name:this.teacherInfo.xm,
                proId:project.proId,
                //8 学校二次审核通过
                state:8,
                time:this.getNowFormatDate(),
                message:"学校二次审核通过"
            }).then((response)=>{
              console.log(response)
            })
            this.$message({
            	message: "学校通过操作成功!",
            	type: "success",
            	offset: screen.height / 2 - 100,
            	center: true,
              duration:1000
            })
          })
      },
			getBatchInfo(){
				this.$api.batch.getAllBatch()
				.then((response)=>{
					console.log(response.data.data)
					this.batchInfo.push(response.data.data.find(item=>item.batchId==this.thisBatchId))
          console.log(this.batchInfo)
          this.batchName=this.batchInfo[0].batchName
				})
			},
        getProjectDataAxios() {
          let that = this;
          this.$api.batch.getProjectByBatchId({
        	batchId: this.thisBatchId
          }).then(
            (response)=>{
        	  console.log(response)
              // var tempData=response.data.data
              // var result=[]
              // var isfl
              // for(var i = 0 ;i < tempData.length;i++ ){
              //   isfl=false;
              //   for(var j=0;j< result.length;j++){
              //     if(tempData[i].proId == result[j].proId){
              //       isfl=true
              //       break}}
              //   if(!isfl){
              //     result.push(tempData[i])
              //   }
              //   }
                // console.log(result)
                this.tableData=response.data.data.filter((item)=>{
               return item.ranking==1 && item.proApproval==3 ||item.ranking==1 && item.proApproval==8 ||item.ranking==1 && item.proApproval==9
              })
                this.allProject=this.tableData
                if(this.depOptions.length==0){
                  this.getProjectDep()
                }
               this.getNameRate()
               this.getExpertScores()
        	})
        },
       toggleSelection(rows) {
        if (rows) {
          rows.forEach(row => {
            this.$refs.multipleTable.toggleRowSelection(row);
          });
        } else {
          this.$refs.multipleTable.clearSelection();
        }
      },
      handleSelectionChange(val) {
        this.multipleSelection = val;
      }
		},
	}

</script>

<style scoped>
/* 	#batchInfoDiv{
		border: 1px #d5dde7 solid;
		border-left: 8px #d5dde7 solid;
	} */
	#batchInfoDivContent{
		margin: 20px;
	}
	#batchInfoDivContent div{
		margin-top: 20px;
	}
	div > p,h4{
		display: inline;
	}


</style>
